﻿using System;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;

namespace SimpleForum.Data.Models.ViewModels
{
    public class UserRegisterViewModel
    {
        [Display(Name = "Username")]
        [Required(ErrorMessage = "This field is required.")]
        [Remote("CheckIfUsernameExists", "User", ErrorMessage = "The username is already in use.")]
        public string UserName { get; set; }

        [Display(Name = "E-mail Address")]
        [DataType(DataType.EmailAddress)]
        [Required(ErrorMessage = "This field is required.")]
        [Remote("CheckIfEmailExists", "User", ErrorMessage = "The e-mail address is already in use.")]
        [Classes.Attributes.Email]
        public string Email { get; set; }

        [DataType(DataType.Password)]
        [Compare("PasswordConfirm", ErrorMessage = "The passwords must match.")]
        [Required(ErrorMessage = "This field is required.")]
        [StringLength(20, MinimumLength = 5)]
        public string Password { get; set; }

        [Display(Name = "Confirm Password")]
        [DataType(DataType.Password)]
        [Required(ErrorMessage = "This field is required.")]
        [StringLength(20, MinimumLength = 5)]
        public string PasswordConfirm { get; set; }

        [Display(Name = "Facebook Username")]
        public string FacebookUsername { get; set; }

        [Display(Name = "Twitter Username")]
        public string TwitterUsername { get; set; }
    }
}